function register(){
	var account = document.getElementById("account");
	var password = document.getElementById("password");
    var repassword = document.getElementById("repassword");
	if((account.value!="")&&(password.value!="")&&(repassword.value!="")){
        if(password.value != repassword.value){
            alert("两次密码输入不匹配！")
        }else{
            var d = new dquery();
            d.post("RegisterAction", "account="+account.value+"&password="+password.value,function(result){
                var data = JSON.parse(result);
                console.log(data.status);
                if(data.status == 1){
                    redirect("login.jsp");
                }else{
                    alert("Account exist already, Please choose another one.")
                }
            });
        }
	}
}

function redirect(url){
	window.location.href=url;  
}


